package run.siyuan.handwriting.spring.v1.servlet.demo.controller;


import run.siyuan.handwriting.spring.v1.servlet.annotation.SYAutowired;
import run.siyuan.handwriting.spring.v1.servlet.annotation.SYController;
import run.siyuan.handwriting.spring.v1.servlet.annotation.SYRequestMapping;
import run.siyuan.handwriting.spring.v1.servlet.annotation.SYRequestParam;
import run.siyuan.handwriting.spring.v1.servlet.demo.service.SsmService;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

/**
 * @program: sy_spring
 * @description:
 * @author: SY
 * @create: 2021-03-30 12:09
 **/
@SYController
@SYRequestMapping("/ssm")
public class SsmController {

    @SYAutowired
    private SsmService ssmService;

    @SYRequestMapping("/test")
    public void test(HttpServletRequest req, HttpServletResponse resp,
                      @SYRequestParam("name") String name){
        String result = ssmService.getList(name);
        try {
            resp.getWriter().write(result);
        } catch (IOException e) {
            e.printStackTrace();
        }
    }

}
